package org.huangrui.redis.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author hr
 * @Create 2024-05-01 13:09
 * http://localhost:7777/swagger-ui/index.html
 */
@Configuration
public class Swagger3Config {
    @Bean
    public GroupedOpenApi uriApi()
    {
        return GroupedOpenApi.builder().group("服务模块").pathsToMatch("/**").build();
    }

    @Bean
    public OpenAPI docsOpenApi()
    {
        return new OpenAPI()
                .info(new Info().title("Redis7")
                        .description("通用设计rest")
                        .version("v1.0"))
                .externalDocs(new ExternalDocumentation()
                        .description("www.atguigu.com")
                        .url("https://yiyan.baidu.com/"));
    }
}
